package d0330;

import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;

public class TestCnstructor {
    public static void main(String[] args) {
        //通过类的字节码来获得构造函数


        try {
            Constructor<Account> con=Account.class.getConstructor(int.class,int.class,double.class);
            Account account = con.newInstance(123,123,8000);
            System.out.println(account);
        } catch (InstantiationException e) {
            e.printStackTrace();
        } catch (IllegalAccessException e) {
            e.printStackTrace();
        } catch (InvocationTargetException e) {
            e.printStackTrace();
        }catch(NoSuchMethodException e){
            e.printStackTrace();
        }

    }
}
